import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    info: {},
    show: false,
    footer: false,
    nav: [],
    docs: {},
    program: null
  },
  getters: {
    docs: (state) => state.docs,
    footer: (state) => state.footer,
    nav: (state) => state.nav,
    program: (state) => state.program,
    info: (state) => state.info,
    show: (state) => state.show
  },
  mutations: {
    SET_PROGRAM: (state, program) => {
      state.program = program;
    },
    SET_DOCS: (state, obj) => {
      state.docs = obj;
    },
    SET_NAV: (state, nav) => {
      state.nav = nav;
    },
    SET_INFO: (state, info) => {
      state.info = info;
    },
    SET_SHOW: (state, bool) => {
      state.show = bool;
    },
    SET_FOOTER: (state, bool) => {
      state.footer = bool;
    }
  },
  actions: {
    setProgram({ commit }, program) {
      commit('SET_PROGRAM', program);
    },
    setDocs({ commit }, obj) {
      commit('SET_DOCS', obj);
    },
    setNav({ commit }, nav) {
      commit('SET_NAV', nav);
    },
    setInfo({ commit }, info) {
      commit('SET_INFO', info);
    },
    setShow({ commit }, bool) {
      commit('SET_SHOW', bool);
    },
    setFooter({ commit }, bool) {
      commit('SET_FOOTER', bool);
    }
  },
  modules: {}
});
